package com.eaoa.uc.account.action;

import java.io.PrintWriter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.eaoa.base.EABaseAction;
import com.eaoa.uc.account.bo.AccountChangePasswordBO;
import com.stony.core.util.CoreUtils;

public class AccountRefreshPasswordAction extends EABaseAction{

	protected ActionForward doWork(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
	
		Long accountno = CoreUtils.parseLong(request.getParameter("accountno"));
		String issuccess="Y";
		
		try {
			new AccountChangePasswordBO(accountno, "" ,  "" , true).execute();
		} catch (RuntimeException e) {
			 issuccess="N";
			e.printStackTrace();
		}finally{
			PrintWriter out = response.getWriter();
			out.write(issuccess);
			out.flush();
			out.close();
		}
		
		return null;
	}
}
